import { Progress } from "@arco-design/web-react";
export default function ProgressComp() {
  const getItem = (title: string, total: number, num: number) => {
    return (
      <div className="w-full mb-4">
        <div className="flex justify-between items-center text-gray-500">
          <span>{title}</span>
          <span>{parseFloat((num / total).toFixed(2)) * 100}%</span>
        </div>
        <Progress
          strokeWidth={10}
          percent={(num / total) * 100}
          width="100%"
          showText={false}
        />
      </div>
    );
  };

  return (
    <div className="flex flex-col overflow-y-auto flex-1 overflow-hidden px-10 ">
      {getItem("自用设备占比", 7850, 6980)}
      {getItem("销售数量占比", 980, 680)}
      {getItem("总销售额市场占比", 846, 750)}
    </div>
  );
}
